from os import rmdir
from re import I
from flask.scaffold import F
import upyun

class MyUp:
    def __init__(self):
        self.up=upyun.UpYun('myupyunmsy','msycc11','9P3tmVB89XoIKG1IP8IEdjXywfFVSqI4')
        self.address = 'D:/p6文件/p6_education/static/upload'

#上传文件

    def upload(self,file,userid):
        with open(self.address+'/'+str(userid)+'/'+file,'rb')as f:
            self.up.put('/'+str(userid)+'/'+file,f)

myup=MyUp()

file = myup.upload('7a.jpg',1)

